package com.eqs.enterprisequestionnaire.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.eqs.enterprisequestionnaire.model.pojo.User;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Set;

public interface UserService extends IService<User> {
    public void insertUser(User user);
    void registerUser(User user);
    public User selectByUserName(String userName);
    public void updateUser(@NotNull User user);
    public void deleteUser(String userName);

    boolean verifyCode(String email, String code);

    void updatePassword(Integer userId,String newPassword);
    User selectById(Integer userId);
    Integer selectIdByEmail(String email);
    String selectEmailById(Integer userId);

    void saveVerificationCode(String email, String verificationCode);
    Integer rightLevel(Integer userId);
    Integer calculateUserAge(Integer id);
    Set<String> getUserRoles(Integer userId);
    Set<String> getUserPermissions(Integer userId);
    List<User> getAllUser();
    List<User> getAllMaleUsers();

    List<User> getAllFemaleUsers();
    List<User> getUsersByCompany(String companyName);
    List<User> getUsersByAgeRange(Integer minAge, Integer maxAge);
    User getCurUser();

    void refreshLogin(String userName,String password);

}
